<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
  <title>友萌</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    html,
    body {
      width: 100%;
      height: 100%;
    }

    .weixin-tip {
      width: 100%;
      height: 100%;
      background: url('./img/bj.png');
      background-size: 100% 100%;
      display: block;
    }
  </style>

</head>

<body>

  <div class="weixin-tip">
  </div>


  <script type="text/javascript">
    function is_weixin() {
      var ua = navigator.userAgent.toLowerCase();
      if (ua.match(/MicroMessenger/i) == "micromessenger") {
        return true;
      } else {
        return false;
      }
    }
    function getOS() {
      const userAgent = navigator.userAgent;
      // 判断 iOS 设备
      if (userAgent.match(/iPhone|iPad|iPod/i)) {
        return "iOS";
      }
      // 判断 Android 设备
      if (userAgent.match(/Android/i)) {
        return "Android";
      }
      // 默认返回 ''
      return "";
    }

    window.onload = () => {
      var isWeixin = is_weixin();
      if (isWeixin) {
        const box = document.querySelector(".weixin-tip");
        box.style.display = "block";
      } else {
        return
        if (getOS() === "iOS") {
          window.location.href = "https://apps.apple.com/app/id1629451281";
        } else {
          window.location.href =
            "https://ndsdn.oss-cn-hongkong.aliyuncs.com/ym.apk";
        }
      }
    }
  </script>

</body>

</html>